﻿using dotHTML.HTML;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Text;
using System.Collections.Generic;
#pragma warning disable 0618

namespace TestdotHTML
{
    
    
    /// <summary>
    ///This is a test class for ATest and is intended
    ///to contain all ATest Unit Tests
    ///</summary>
    [TestClass()]
    public class ATest {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext {
            get {
                return testContextInstance;
            }
            set {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for A Constructor
        ///</summary>
        [TestMethod()]
        public void AConstructorTest() {
            string href = "href";
            string text = "text";
            A target = new A(href, text);
            Assert.AreEqual(target.Href, "href");
            Assert.IsTrue(target.Children.Count == 1);
        }

        /// <summary>
        ///A test for Charset
        ///</summary>
        [TestMethod()]
        public void CharsetTest() {
            A target = new A();
            target.Charset.Add("utf-8");
            target.Charset.Add("us-ascii");
            Assert.IsTrue(target.Charset.Contains("utf-8"));
            Assert.IsTrue(target.Charset.Contains("us-ascii"));
            Assert.IsTrue(target.Charset.Count == 2);
        }

        /// <summary>
        ///A test for Coords
        ///</summary>
        [TestMethod()]
        public void CoordsTest() {
            A target = new A();
            target.Coords.Add(1);
            target.Coords.Add(2);
            Assert.IsTrue(target.Coords.Contains(1));
            Assert.IsTrue(target.Coords.Contains(2));
            Assert.IsTrue(target.Coords.Count == 2);
        }

        /// <summary>
        ///A test for Href
        ///</summary>
        [TestMethod()]
        public void HrefTest() {
            A target = new A();
            string expected = "href";
            string actual;
            target.Href = expected;
            actual = target.Href;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for HrefLang
        ///</summary>
        [TestMethod()]
        public void HrefLangTest() {
            A target = new A();
            string expected = "hreflang";
            string actual;
            target.HrefLang = expected;
            actual = target.HrefLang;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Media
        ///</summary>
        [TestMethod()]
        public void MediaTest() {
            A target = new A();
            string expected = "media";
            string actual;
            target.Media = expected;
            actual = target.Media;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Name
        ///</summary>
        [TestMethod()]
        public void NameTest() {
            A target = new A();
            string expected = "name";
            string actual;
            target.Name = expected;
            actual = target.Name;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Ping
        ///</summary>
        [TestMethod()]
        public void PingTest() {
            A target = new A();
            target.Ping.Add("ping1");
            target.Ping.Add("ping2");
            Assert.IsTrue(target.Ping.Count == 2);
            Assert.IsTrue(target.Ping.Contains("ping1"));
            Assert.IsTrue(target.Ping.Contains("ping2"));
        }

        /// <summary>
        ///A test for Rel
        ///</summary>
        [TestMethod()]
        public void RelTest() {
            A target = new A();
            target.Rel.Add("rel1");
            target.Rel.Add("rel2");
            Assert.IsTrue(target.Rel.Contains("rel1"));
            Assert.IsTrue(target.Rel.Contains("rel2"));
            Assert.IsTrue(target.Rel.Count == 2);
        }

        /// <summary>
        ///A test for Rev
        ///</summary>
        [TestMethod()]
        public void RevTest() {
            A target = new A();
            string expected = "rev";
            string actual;
            target.Rev = expected;
            actual = target.Rev;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Shape
        ///</summary>
        [TestMethod()]
        public void ShapeTest() {
            A target = new A();
            Nullable<ShapeChoices> expected = ShapeChoices.Circle;
            Nullable<ShapeChoices> actual;
            target.Shape = expected;
            actual = target.Shape;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Target
        ///</summary>
        [TestMethod()]
        public void TargetTest() {
            A target = new A();
            string expected = "target";
            string actual;
            target.Target = expected;
            actual = target.Target;
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for Type
        ///</summary>
        [TestMethod()]
        public void TypeTest() {
            A target = new A();
            string expected = "type";
            string actual;
            target.Type = expected;
            actual = target.Type;
            Assert.AreEqual(expected, actual);
        }

        [TestMethod()]
        public void ToStringTest() {
            A target = new A();
            target.Charset.Add("utf-8");
            target.Charset.Add("us-ascii");
            target.Coords.Add(1);
            target.Coords.Add(2);
            target.Href = "href";
            target.HrefLang = "hreflang";
            target.Media = "media";
            target.Name = "name";
            target.Ping.Add("ping1");
            target.Ping.Add("ping2");
            target.Rel.Add("rel1");
            target.Rel.Add("rel2");
            target.Rev = "rev";
            target.Shape = ShapeChoices.Circle;
            target.Target = "target";
            target.Type = "type";
            Assert.AreEqual("<a charset=\"utf-8 us-ascii \" " +
                "coords=\"1,2,\" " +
                "href=\"href\" " +
                "hreflang=\"hreflang\" " +
                "media=\"media\" " +
                "name=\"name\" " +
                "ping=\"ping1 ping2 \" " +
                "rel=\"rel1 rel2 \" " +
                "rev=\"rev\" " +
                "shape=\"circle\" " +
                "target=\"target\" " +
                "type=\"type\"></a>", target.ToString());
        }
    }
}
